package com.baidu.common;


import lombok.Data;

@Data
public class Rest {
    private Integer code;
    private Object data;
    private String msg;

    public static Rest Success(Object data){
        return Success(data,"请求成功");
    }
    public static Rest Success(Object data,String msg){
        Rest rest = new Rest();
        rest.setData(data);
        rest.setCode(200);
        rest.setMsg(msg);
        return rest;
    }

    public static Rest faild(String msg){
        Rest rest = new Rest();
        rest.setData(null);
        rest.setCode(400);
        rest.setMsg(msg);
        return rest;
    }

}
